﻿using Approval.API.Applcation.Command.PurchaseRelationCommand;
using Approval.API.Applcation.Command.RLZRelationCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using PublicCommon;

namespace Approval.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PurchaseRelationController : ControllerBase
    {
        private readonly IMediator mediator;

        public PurchaseRelationController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 提交采购审批
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<int> PurchaseRelationAdd(PurchaseRelationCreateCommand command)
        {
            return mediator.Send(command);
        }

        /// <summary>
        /// 采购审批转批操作
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Audit> PurchaseRelationInfo( PurchaseRelationApprovalCommand command)
        {
            return mediator.Send(command);
        }
    }
}
